<template>
  <div class="price">
    <span v-if="showPrice">&yen;{{ price }}</span>
    <span v-else>暂无报价</span>
    <span v-if="priceTag" class="price-tag">
      {{ priceTag }}
    </span>
  </div>
</template>
<script>
export default {
  name: 'Price',
  props: {
    price: {
      type: [String, Number],
      default: ''
    },
    priceTag: {
      type: [String],
      default: undefined
    }
  },
  data() {
    return {
    }
  },
  computed: {
    showPrice() {
      return this.price < 999999 && this.$isDef(this.price) && !this.$isEmpty(this.price)
      // return false
    }
  },
  methods: {
  }
}
</script>
<style lang="less" scoped>
.price{
  color: #F15643;
  font-size: 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  &>:not(:first-child){
    margin-left: 5px;
  }
  .price-tag{
    display: inline-block;
    height: 16px;
    line-height: 16px;
    font-size: 12px !important;
    color: #fff;
    background-color: #ef6443;
    padding: 2px 4px;
    border-radius: 2px;
    box-sizing: border-box;
  }
}
</style>
